///*
// * 对比功能模块
// */
(function($){
	$("#cityChose .m-dropList-a").toggle(function(){
		setTimeout(function(){$(".cityChose-box").show();$("#cityChose").addClass("open");},0);
	},function(){
		setTimeout(function(){$(".cityChose-box").hide();$("#cityChose").removeClass("open");},0);
	});
	$("#cityChose .close2").click(function(){
//		$(".cityChose-box").hide();
//		$("#cityChose").removeClass("open");
		$("#cityChose .m-dropList-a").trigger("click");
	});
})(jQuery);
//(function($){
//    $.showCityList = function(){
////    	var cityListStr = '';
////    	var tuiJianListStr = '';
////    	var nowUrl = window.location.href;
////    	var nowType = "sale";
////    	if(nowUrl.indexOf("lease") != -1){
////    		nowType = "lease";
////    	}else if(nowUrl.indexOf("xiaoqu") != -1){
////    		nowType = "xiaoqu";
////    	}
////        $.ajax({
////            "url":"/index.php?mod=common&act=citylist&nowType="+nowType+"&timetemp="+new Date().getTime(),
////            "type":"GET",
////            "data":null,
////            "async":false,
////            "success":function(retStr){
////            	retStr = retStr.replace(/^\s*/gi,"").replace(/\s*$/gi,"");
////            	cityListStr = retStr;
////            }
////        });
////        $.ajax({
////            "url":"/index.php?mod=common&act=tuijian&nowType="+nowType+"&timetemp="+new Date().getTime(),
////            "type":"GET",
////            "data":null,
////            "async":false,
////            "success":function(dataStr){
////            	dataStr = dataStr.replace(/^\s*/gi,"").replace(/\s*$/gi,"");
////            	tuiJianListStr = dataStr;
////            }
////        });
////    	var cityName = g_city_info['FName'];
////    	if(cityName.indexOf("市") != -1){
////    		cityName = cityName.replace("市",'');
////    	}
////    	var hostSite = "http://"+window.location.host+"/";
////    	var cityList =
////    		'\
////             <a class="m-dropList-a" href="javascript:void(0);">'+cityName+'</a>\
////			 <div class="cityChose-box" style="display:none;">\
////			 <i class="arr"></i>\
////			 <div class="tit"><a  href="javascript:void(0);return false;" style="text-decoration:none;cursor:text;" class="more">推荐城市</a><span class="close2"></span></div>\
////			 <div class="zbcs">\
////             <p>\
////	               '+tuiJianListStr+'\
////            </p>\
////         </div>\
////		 <div class="cityChose-list">\
////	           <h3>全国城市列表</h3>\
////			   <div id="scrollBox2">\
////				    <div class="scrollContent" style="font-family:\'宋体\',\'Arial Narrow\';">\
////				    '+cityListStr+'\
////				    </div>\
////			   </div>\
////		</div>\
////		';
////
////    	$("#cityChose").html(cityList);
//    	var p2 = new scroll ('scrollBox2' );
//    	$("#cityChose .m-dropList-a").toggle(function(){
//    		setTimeout(function(){$(".cityChose-box").show();$("#cityChose").addClass("open");},0);
//    	},function(){
//    		setTimeout(function(){$(".cityChose-box").hide();$("#cityChose").removeClass("open");},0);
//    	});
//    	$("#cityChose .close2").click(function(){
////    		$(".cityChose-box").hide();
////    		$("#cityChose").removeClass("open");
//    		$("#cityChose .m-dropList-a").trigger("click");
//    	})
//    	
//    	$(".zbcs a").click(function(){$("#cityChose .m-dropList-a").trigger("click")});
////    	$(document).click(function(){
////    		$("#cityChose .close2").trigger("click");
////    	});
//    };
//})(jQuery);
////字符串操作方法
//String.prototype.replaceAll = function(content,replayWith){   
//    return this.replace(new RegExp(content,"gm"),replayWith);   
//}
//String.prototype.ltrim = function ltrim(){
//    return this.replace(/^\s*/gi,"");
//}
//String.prototype.rtrim=function rtrim(){
//    return this.replace(/\s*$/gi,"");
//}
//String.prototype.trim = function trim(){
//    return this.toString().ltrim().rtrim();
//}
//String.prototype.toJson = function(){
//    var str = this.replace(/\n|\r/gi,"");
//    return eval('('+str+')');
//}
///*
// * =================================
// * **所有页面初始化***
// * =================================
// */
//$(document).ready(function(){
//	scroll.prototype = {//scroll is a function
//			mousedown:function(e){           
//					var self = this;
//					var e = e || window.event;
//					self.bar.y = e.clientY;
//					self.bar.t = parseInt( self.bar.style.marginTop );
//					document.onmousemove = function(e){ self.mousemove(e); }
//					stopDefault(e);
//			},
//			mousemove:function(e){
//					var e = e || window.event;
//					this.marginTop = this.bar.t + ( e.clientY - this.bar.y );
//					if( this.marginTop < 0 ) {
//							this.marginTop = 0;
//					}
//					if( this.marginTop > this.obj.clientHeight - this.bar.offsetHeight ){
//							this.marginTop = this.obj.clientHeight - this.bar.offsetHeight;
//					}
//					this.bar.style.marginTop = this.marginTop + "px";
//					this.content.scrollTop = ( this.content.scrollHeight - this.obj.offsetHeight ) * parseInt( this.marginTop ) / ( this.obj.clientHeight - this.bar.clientHeight );
//					document.onmouseup = function(e){ document.onmousemove = null; }
//					stopDefault(e);
//			}
//	}
//	$.showCityList();
//});
//function scroll(id){
//	 var self = this;
//	 this.obj = document.getElementById(id);
//	 this.content = this.obj.getElementsByTagName("div")[0];
//	 this.bar = document.createElement("div");
//	 this.bar.className = "scrollBar";
//	 this.barBg = document.createElement("span");
//	 this.barBg.className = "barBg";
//	 this.topBg = document.createElement("span");
//	 this.topBg.className = "topBg";
//	 this.bar.style.marginTop = 0;
////	 this.bar.style.height = parseInt( this.obj.offsetHeight / this.content.scrollHeight  * this.obj.offsetHeight) + "px";
//	 this.obj.appendChild( this.bar );
//	 this.bar.appendChild( this.barBg );
//	 this.barBg.appendChild( this.topBg );
//	 this.bar.y;
//	 this.srcElement;
//	 this.marginTop;
//	 this.bar.onmousedown = function(e){ self.mousedown(e); }
//}
//function stopDefault( e ) {
//		if ( e && e.preventDefault )
//				e.preventDefault();
//		else
//				window.event.returnValue = false;
//		return false;
//}
